{% extends 'basic.html' %}
{% block title %}{{ TITLE }}-{{ article.title }}{% endblock %}
{% block page_title %}{{ article }}{% endblock %}
{% block main %}
  <div class="text-center margin-tb-1">
    {{ article.author }} {{ article.created_time }} 阅读({{ article.views }}) 评论({{ article.comment_set.count }})
  </div>
  <article class="article">
    {{ article.md_content | safe }}
  </article>
  <div id="coment" class="margin-tb-2">
    <h5>
      留言 ({{ article.comment_set.count }}条)
      <a href="{% url 'blog:comment' article.pk %}" class="font-size-10">我要留言</a>
    </h5>
    <hr>
    <ul class="no-padding-left">
      {% for comment in article.comment_set.all %}
        <li class="comment margin-tb-1">
          <span class="font-size-8">{{ comment.user }} {{ comment.created_time }} 说：</span>
          <div class="text">
            {{ comment.content }}
          </div>
        </li>
      {% empty %}
        暂无评论
      {% endfor %}
    </ul>
  </div>
{% endblock %}
{% block toc %}
  <div>
    <h5>文章目录</h5>
    {{ article.md_toc|safe }}
  </div>
{% endblock %}